package com.gtek.room;
import org.red5.io.utils.ObjectMap;
public class User {
	
	 
    private String id;
    
    private String nickName;
    


    public User() {
     
        
    }
    
    public String getId() {
        return id;
    }    
    
	
    public void setId(String id) {
        this.id = id;
    }
	
    public String getNickName() {
        return nickName;
    }
    
    public void setNickName(String nickName) {
        this.nickName = nickName;
    }
    
    @Override
    public String toString() {
            return String.format("User id %s Nickname %s ",
                            id, nickName);
    }
    
    
    public ObjectMap<String, Object> genFlexChatUser() {
        ObjectMap<String, Object> objectMap = new ObjectMap<String, Object>();
        objectMap.put("id", id);
        objectMap.put("nickName", nickName);
        return objectMap;
    }
    

    public void updateChatUser(ObjectMap<String, Object> flexChatUser) 
    {
          
                    if(this.id == null) {
                            this.id = (String) flexChatUser.get("id");
                 
                    this.nickName = (String)flexChatUser.get("nickName");
                
                    
             
         
                    }       
    
    
    	}
    
}